using Senparc.Weixin.Entities;
using Senparc.Weixin.HttpUtility;
using Senparc.Weixin.QY.AdvancedAPIs.App;
using System;
namespace Senparc.Weixin.QY.AdvancedAPIs
{
	public static class AppApi
	{
		public static GetAppInfoResult GetAppInfo(string accessToken, int agentId, int timeOut = 10000)
		{
			string url = string.Format("https://qyapi.weixin.qq.com/cgi-bin/agent/get?access_token={0}&agentid={1}", accessToken, agentId);
			return Get.GetJson<GetAppInfoResult>(url, null);
		}
		public static QyJsonResult SetApp(string accessToken, SetAppPostData data, int timeOut = 10000)
		{
			string url = string.Format("https://qyapi.weixin.qq.com/cgi-bin/agent/set?access_token={0}", accessToken);
			return Get.GetJson<QyJsonResult>(url, null);
		}
		public static GetAppListResult GetAppList(string accessToken, int timeOut = 10000)
		{
			string url = string.Format("https://qyapi.weixin.qq.com/cgi-bin/agent/list?access_token={0}", accessToken);
			return Get.GetJson<GetAppListResult>(url, null);
		}
	}
}
